#ifndef __VENDINGMACHINE_H__
#define __VENDINGMACHINE_H__
#include "printer.h"
#include "nameserver.h"
#include "watcard.h"
#include "PRNG.h"
#include <map>
using namespace std;

class Printer;
extern PRNG prng;

class VendingMachine { // general vending machine
	protected:
		unsigned int stockList[4];
		unsigned int id, MSRP;
		bool full;
    //enum Flavours {Blues, Classical, Rock, Jazz};
    // PRNG prng;
    typedef int Flavours;
    Printer *prt;
	public:

    bool getFull();
		enum Status { BUY, STOCK, FUNDS }; // purchase status: successful buy, out of stock, insufficient funds
		VendingMachine( Printer &prt, NameServer &nameServer, unsigned int id, unsigned int sodaCost, unsigned int maxStockPerFlavour );
		virtual ~VendingMachine();
		// necessary to trigger destructors in inherited classes
		virtual Status buy( Flavours flavour, WATCard *&card ); // YOU DEFINE FLAVOURS
		virtual unsigned int *inventory();
		virtual void restocked();
		virtual unsigned int cost();
		virtual unsigned int getId();
};


class VendingMachineCardEater : public VendingMachine { // specific vending machine
	public:
		VendingMachineCardEater( Printer &prt, NameServer &nameServer, unsigned int id, unsigned int sodaCost, unsigned int maxStockPerFlavour );
		// member routines from VendingMachine
		Status buy( Flavours flavour, WATCard *&card ); // YOU DEFINE FLAVOURS
      ~VendingMachineCardEater();
		unsigned int *inventory();
		void restocked();
		unsigned int cost();
		unsigned int getId();
};

class VendingMachineOverCharger : public VendingMachine { // specific vending machine
	public:
		VendingMachineOverCharger( Printer &prt, NameServer &nameServer, unsigned int id, unsigned int sodaCost, unsigned int maxStockPerFlavour );
		// member routines from VendingMachine
		Status buy( Flavours flavour, WATCard *&card ); // YOU DEFINE FLAVOURS
      ~VendingMachineOverCharger();
		unsigned int *inventory();
		void restocked();
		unsigned int cost();
		unsigned int getId();
};

#endif